package com.example.ljdemo.infrastructure.mybatis;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.Setter;

import java.time.LocalDateTime;

/**
 * 需要Auditing的对象，可以继承此基类
 * @author jingjing.dong
 * @since 2021/4/15-18:03
 */
@Setter(AccessLevel.PRIVATE)
@Getter
public abstract class AuditingEntity {
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    LocalDateTime createTime;
    @TableField(fill = FieldFill.INSERT)
    String createBy;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    LocalDateTime updateTime;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    String updateBy;
}
